home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / other / dwarfx-tng / dwarfx / dwarfpontoon.amirx < prev    next >
Text File  |  1999-04-19  |  28KB  |  36 lines

  1. /* $VER: Pontoon V1.4 for AmIRC 1.x Written By David "COolWAve" Newton.
  2. \\
  3. // Now included as part of DWaRFxTNG...
  4. \\
  5. //
  6. \\ THIS SCRIPT NEEDS THE REXXSUPPORT LIBRARY!!!!!!
  7. // This rexx script allows people to play BlackJack/21/Pontoon across IRC.
  8. \\ If you don't know how to play, see HELP_MESSAGE. If you run this script,
  9. // and want to join in, you will need to open a query window on yourself, 
  10. \\ to send the commands like !JOIN, !ANTE, !TWIST etc...
  11. //
  12. \\ Put this script in AmIRC:rexx/ and run it from the rexx menu, or by
  13. // adding it as an alias by typing the following line in the channel 
  14. \\ message input box (without the 's) :
  15. //              '/Alias Pontoon /rx Pontoon.AMIRX'
  16. \\ and then just type '/Pontoon' to run pontoon in your current channel. 
  17. //
  18. \\ To Do: auto topic option, scoreboard (top 10 scores ever!)
  19. //        Player password, so that player can continue another day!
  20. \\
  21. // To contact me, try IRC (#AmIRC DALNet),or email rexx@nbsamiga.demon.co.uk
  22. \\
  23. // This Script is copyrighted by David C. Newton and is available as
  24. \\ FreeWare Software.
  25. //
  26. \\ DISCLAIMER:
  27. //  THIS SCRIPT IS SUPPLIED 'AS IS' : THE ENTIRE RISK AS TO THE USE OF THE
  28. \\  SCRIPT IS ASSUMED BY THE USER. IN NO EVENT WILL THE AUTHOR BE LIABLE
  29. //  FOR DIRECT OR INDIRECT DAMAGE OR LOSS RESULTING FROM THE USE/MISUSE
  30. \\  OF THIS SCRIPT.
  31. //
  32. \\ Big Thanks goto : Clasylady and Tig-Too (the two greatest beta testers!)
  33. */
  34. ;Options Results;If ~Show(L,'rexxsupport.library') then;do;If ~Addlib('rexxsupport.library',0,-30,0) then;do;"Echo P="d2c(27)"x«Pontoon» "d2c(2)"Error:"d2c(2)" Unable to open rexxsupport.library!";Exit;End;End;"GetChannel";channel=result;"GetMyNick";mynick=result;ouradr=Address();quitmsg="";pontoon= d2c(2)"Pontoon"d2c(2);Call SETUP;Call WRITE(1,"","AmIRC "pontoon" Special Edition for |DWaRFx| By David Newton started in this channel.");Call WRITE(1,"","Type !JOIN to join in the fun, or type !HELP for info.");Call MYSELF(1,"MASTER COMMANDS ACTIVATED! Message yourself with %%HELP to view commands!");Call SETUP_PLAYERS;Do While number_of_players>1;Call Delay(100);Call RESET_PLAYERS;Call ANTE_PLAYERS;If number_of_players=1 Then Break;Call SHUFFLE_DECK;split=1;temp=1;Call DEAL_ALL_PLAYERS;temp=2;Call DEAL_ALL_PLAYERS;player=1;Call CHECK_PLAYER_PONTOON;If done.1=1 Then Call WRITE(1,"","Dealer has Pontoon and has beaten everbody!");Else;Do;Do count=1 To players_in;player=players_list.count;Call CHECK_PLAYER_PONTOON;End;End;current_player=1;Do While current_player<players_in;player=players_list.current_player;If done.player=1 Then current_player=current_player+1;Else Break;End;split=1;player=players_list.current_player;Do While done.1=0;If player=1 Then;Do;Call WRITE(3,"","It's the Dealers turn.");Call WRITE(3,"","Dealer Faces Dealer's cards.");Do While done.1=0;Call WRITE(3,"","Dealer Has "cards.player.1" cards (Total "total.player.1") : "hand.player.1".");If total.1.1<16 Then;Do;If cards.1.1<5 Then;Do;Call WRITE(3,"","Dealer !TWIST");Call PLAYER_TWIST;End;Else done.1=1;End;Else;Do;If cards.1.1<5 Then;Do;If total.1.1>21 Then done.1=1;If total.1.1<19 Then;Do;temp=19-total.1.1;temp=temp*10;If Random(1,100,Time(S))<temp Then;Do;Call WRITE(3,"","Dealer !TWIST");Call PLAYER_TWIST;End;Else done.1=1;End;Else done.1=1;End;Else done.1=1;End;End;If total.1.1<22 Then Call WRITE(3,"","Dealer !STICK");If total.1.1>21 Then Call WRITE(3,"","Dealer Has Bust!");If cards.1.1=5&total.1.1<22 Then Call WRITE(3,"","Dealer Has a Five Card Trick!");End;Else;Do;If hand.player.2="" Then Call WRITE(1,"","Dealer turns to "player_name.player" and say's it's your go.");Else Call WRITE(1,"","Dealer turns to "player_name.player" and say's it's your "numberword.split" hand.");player_lost=0;Do While done.player=0;If player_lost=0 Then;Do;Call SET_PLAYER_COMMANDS;If hand.player.2="" Then Call QWRITE(1,player_name.player,"You have "cards.player.1" cards (Total "total.player.1") : "hand.player.1".");Else;Do;Do count=1 To 4;If count ~=split&hand.player.count ~="" Then Call QWRITE(1,player_name.player,"You have "cards.player.count" cards in your "numberword.count" hand (Total "total.player.count") : "hand.player.count".");End;Call QWRITE(1,player_name.player,"You have "cards.player.split" cards in your "numberword.split" hand [CURRENT] (Total "total.player.split") : "hand.player.split".");End;Call QWRITE(1,player_name.player,"Your options are : !QUIT !HELP"playeropts);End;If player_lost=2 Then;Do;Call QWRITE(1,player_name.player,"Hurry up with your commands, what are you waiting for??");End;If player_lost=3 Then;Do;player_responded=7;End;Else;Do;player_responded=0;Call DO_PAUSE;End;Do While player_responded=0;"GetLine";/* Parse Pull line.command line.prefix line.rest */;temp=Pos("!",line.prefix)-1;If temp<0 Then Iterate;nick=Left(line.prefix,temp);mess=Upper(line.rest);player_command="";found=0;Do count=2 To number_of_players;If nick=player_name.count Then found=count;End;Call MASTER_COMMANDS;If nick=mynick&mess=quitmsg Then Break;If Upper(Compress(line.command))="NICK" Then;Do;If nick=mynick Then mynick= Delstr(line.dest,1,1);If found ~=0 Then player_name.found= Delstr(line.dest,1,1);End;If Upper(Compress(line.command))="JOIN"& Delstr(line.dest,1,1)=channel Then;Do;If found=0|player_ante.found=-1 Then;Do;Call WRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton is being played in this channel.");Call WRITE(1,nick,"Type !JOIN to join in the fun, or type !HELP for info.");End;Else;Do;Call WRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton is being played in this channel.");Call WRITE(1,nick,"Welcome back "player_name.player", you are still joined in the game and you have $"player_cash.found" left.");End;End;If Pos(":!JOIN",mess) ~=0 Then;Do;If found=0|player_ante.found=-1 Then;Do;number_of_players=number_of_players+1;player_name.number_of_players=nick;player_cash.number_of_players=100;player_ante.number_of_players=0;Call WRITE(1,nick,"You have joined in this game!");Call WRITE(1,nick,"There is a hand already being played! You will have to wait until the start of the next hand to ante!");End;Else Call WRITE(1,nick,"You have already joined this game!");End;If Pos(":!QUIT",mess) ~=0&found ~=0 Then;Do;split=4;player_ante.found=-1;Call WRITE(1,nick,"You have quit "pontoon", I hope you enjoyed playing it!");End;If found=player Then player_command=Compress(mess);Else Iterate;If player_command=":!QUIT" Then player_responded=1;If player_command=":!HELP" Then player_responded=2;If player_command=":!STICK" Then player_responded=3;If player_command=":!TWIST" Then player_responded=4;If player_command=":!SPLIT" Then player_responded=5;If player_command=":!DOUBLE" Then player_responded=6;End;If player_responded=1 Then done.player=1;If player_responded=2 Then Call HELP_MESSAGE;If player_responded=3&opt0=1 Then done.player=1;If player_responded=4&opt1=1 Then Call PLAYER_TWIST;If player_responded=5&opt2=1 Then Call PLAYER_SPLIT;If player_responded=6&opt3=1 Then Call PLAYER_DOUBLE;If opt1=0& done.player=0 Then;Do;done.player=1;Call WRITE(1,"","Dealer has automatically stuck for you "player_name.player", because you have 5 cards!");End;If player_responded=0 Then player_lost=player_lost+1;Else player_lost=0;If player_responded=7 Then;Do;Call QWRITE(1,player_name.player,"You haven't sent a command in time, so you have been dropped from this hand!");Call WRITE(1,"",player_name.player" hasn't sent a command in 3 minutes, so the Dealer will move onto the next player!");done.player=1;player_ante.player=-2;End;End;End;Do While done.player=1;split=split+1;If hand.player.split ~=""&split<5 Then;Do;If total.player.split ~=21|Pos("Ten",hand.player.split) ~=0 Then done.player=0;End;Else;Do;current_player=current_player+1;split=1;player=players_list.current_player;End;End;End;/* hand over, so tell channel, and all people and work out winners and
  35.  \\ losers... and remove null players and correct player arrays
  36.  */;Call WRITE(1,"","Dealer has finished.");Call SORT_WINNERS;Do count=2 To number_of_players;If player_cash.count=0 Then;Do;player_ante.count=-1;Call WRITE(1,"",player_name.count" has no cash left.");Call WRITE(1,player_name.count,"You have run out of cash. If you want to play again use !JOIN.");End;End;/* remove null players */;found=1;count=2;Do Until count>number_of_players;If player_ante.count=-1 Then;Do;If count<number_of_players Then;Do;Do temp=count To number_of_players-1;current_player=temp+1;player_name.temp=player_name.current_player;player_cash.temp=player_cash.current_player;player_ante.temp=0;End;number_of_players=number_of_players-1;End;End;Else;Do;found=found+1;count=count+1;End;End;number_of_players=found;If number_of_players=1 Then Call WRITE(1,"","Nobody is left in the game, so "pontoon" is quiting!");End;Exit;SORT_WINNERS:;Call Delay(100);players_in=players_in-1;Call WRITE(3,"","Let's see who's beaten the dealer, and who hasn't!");Call WRITE(3,"","Dealer's hand : "cards.1.1" cards (Total "total.1.1") : "hand.1.1".");temp=total.1.1;If temp>21 Then temp=0;If cards.1.1=5&total.1.1<22 Then;Do;Call WRITE(3,"","Dealer has a FIVE CARD TRICK!");temp=-1;End;If cards.1.1=2&total.1.1=21&Pos("Ten",hand.1.1)=0 Then;Do;Call WRITE(3,"","Dealer has PONTOON!");temp=-2;End;Do current_player=1 To players_in;Call Delay(100);player=players_list.current_player;split=1;Do While hand.player.split ~="";winnings=0;If hand.player.2="" Then Call WRITE(3,"",player_name.player"'s hand : "cards.player.1" cards (Total "total.player.1") : "hand.player.1".");Else Call WRITE(3,"",player_name.player"'s "numberword.split" hand : "cards.player.1" cards (Total "total.player.1") : "hand.player.1".");If player_ante.player<0 Then;Do;If player_ante.player=-1 Then Call WRITE(3,"",player_name.player" dropped out!");Else Call WRITE(3,"",player_name.player" ignored the Dealer and got skipped!");End;Else;Do;If cards.player.split=5&total.player.split<22 Then;Do;If temp=-1 Then;Do;winnings=-1;Call WRITE(3,"",player_name.player" has a FIVE CARD TRICK, but didn't beat the Dealer and lost $"player_ante.player"!");End;Else;Do;winnings=player_ante.player*3;Call WRITE(3,"",player_name.player" has a FIVE CARD TRICK, and beat the Dealer to win $"winnings"!");End;End;If cards.player.split=2&total.player.split=21 Then;Do;If Pos("Ten",hand.player.split) ~=0 Then;Do;If temp=-2 Then;Do;winnings=-1;Call WRITE(3,"",player_name.player" has PONTOON, but didn't beat the Dealer and lost $"player_ante.player"!");End;Else;Do;winnings=player_ante.player*3;Call WRITE(3,"",player_name.player" has PONTOON, and beat the Dealer to win $"winnings"!");End;End;End;If cards.player.split=3&total.player.split=21 Then;Do;If Subword(hand.player.split,1)="Seven"&Subword(hand.player.split,4)="Seven" Then;Do;winnings=player_ante.player*4;Call WRITE(3,"",player_name.player" has ROYAL PONTOON, and beat the Dealer to win $"winnings"!");End;End;If winnings=0 Then;Do;If total.player.split>21 Then Call WRITE(3,"",player_name.player" has BUST, and lost $"player_ante.player"!");Else;Do;If total.player.split<=temp|temp<0 Then Call WRITE(3,"",player_name.player" has "total.player.split", but didn't beat the Dealer and lost $"player_ante.player"!");Else;Do;winnings=player_ante.player*2;Call WRITE(3,"",player_name.player" has "total.player.split", and beat the Dealer to win $"winnings"!");End;End;End;End;If winnings>0 Then player_cash.player=player_cash.player+winnings;split=split+1;End;End;Return;PLAYER_SPLIT:;Call WRITE(1,"","Dealer faces "player_name.player"'s cards.");Call WRITE(1,"",player_name.player" has 2 cards (Total "total.player.split") : "hand.player.split".");temp=Pos(",",hand.player.split);count=split_next.player;split_next.player=split_next.player+1;cards.player.split=1;cards.player.count=1;hand.player.count=Left(hand.player.split,temp-1);hand.player.split= Delstr(hand.player.split,1,temp+1);Call WRITE(1,"","Dealer splits "player_name.player"'s cards!");player_cash.player=player_cash.player-player_ante.player;Call WRITE(1,"",player_name.player" ante's for another hand!");If aces.player.split=1 Then;Do;total.player.split=11;total.player.count=11;aces.player.count=1;can_split.player.split=0;End;Else;Do;total.player.split=total.player.split/2;total.player.count=total.player.split;End;old_split=split;Call DEAL_CARD;split=count;Call WRITE(1,"","Dealer deals "player_name.player" a second card to each new hand.");Call DEAL_CARD;Call CHECK_PLAYER_PONTOON;done.player=0;split=old_split;Call CHECK_PLAYER_PONTOON;Return;PLAYER_DOUBLE:;Call WRITE(1,"","Dealer faces "player_name.player"'s cards.");Call WRITE(1,"",player_name.player" has 2 cards (Total "total.player.1") : "hand.player.1".");player_cash.player=player_cash.player-player_ante.player;player_ante.player=player_ante.player*2;Call WRITE(1,"",player_name.player" doubles ante!");Call PLAYER_TWIST;Call WRITE(1,"",player_name.player" has 3 cards (Total "total.player.1") : "hand.player.1".");done.player=1;Return;PLAYER_TWIST:;Call DEAL_CARD;temp=cards.player.split;Call WRITE(1,"","Dealer deals "player_name.player" the "this_card".");Return;SET_PLAYER_COMMANDS:;opt0=0;opt1=0;opt2=0;opt3=0;playeropts="";If total.player.split>15|cards.player.split=5 Then opt0=1;If cards.player.split=2 Then;Do;If total.player.split>8&total.player.split<12 Then opt3=1;If can_split.player.split=1 Then opt2=1;End;If cards.player.split<5 Then opt1=1;If player_cash.player<=player_ante.player Then;Do;opt3=0;opt2=0;End;If opt0=1 Then playeropts=playeropts||" !STICK";If opt1=1 Then playeropts=playeropts||" !TWIST";If opt2=1 Then playeropts=playeropts||" !SPLIT";If opt3=1 Then playeropts=playeropts||" !DOUBLE";Return;CHECK_PLAYER_PONTOON:;If total.player.split=21&cards.player.split=2 Then;Do;temp=hand.player.split;If Pos("Ten",temp)=0 Then;Do;Call WRITE(1,"",player_name.player" faces the Ace of "Word(Compress(temp,","),Find(temp,"Ace")+2)".");Call WRITE(1,"",player_name.player" has Pontoon!");done.player=1;End;End;Return;DEAL_ALL_PLAYERS:;Call WRITE(3,"","Dealer deals all players their "numberword.temp" card.");Do current_player=1 To players_in;player=players_list.current_player;Call DEAL_CARD;If player ~=1 Then;Do;If cards.player.1=1 Then Call QWRITE(1,player_name.player,"You have "cards.player.1" card (Total "total.player.1") : "hand.player.1".");Else Call QWRITE(1,player_name.player,"You have "cards.player.1" cards (Total "total.player.1") : "hand.player.1".");End;End;Return;DEAL_CARD:;If deck_position=52 Then;Do;Call WRITE(2,"","Dealer has run out of cards, getting another deck.");Call SHUFFLE_DECK;End;newcard= deck.deck_position;newsuit=1;Do While newcard>13;newsuit=newsuit+1;newcard=newcard-13;End;If cards.player.split=1&Pos(numbers.newcard,hand.player.split) ~=0 Then;Do;If player ~=1 Then can_split.player.split=1;End;Else can_split.player.split=0;this_card=numbers.newcard" of "suit.newsuit;If cards.player.split>0 Then hand.player.split=hand.player.split", "this_card;Else hand.player.split=hand.player.split||this_card;total.player.split=total.player.split+value.newcard;If newcard=1 Then aces.player.split=aces.player.split+1;If total.player.split>21&aces.player.split>0 Then;Do;total.player.split=total.player.split-10;aces.player.split=aces.player.split-1;End;cards.player.split=cards.player.split+1;deck_position= deck_position+1;Return;RESET_PLAYERS:;Do player=1 To number_of_players;Do temp=1 To 4;hand.player.temp="";total.player.temp=0;cards.player.temp=0;aces.player.temp=0;can_split.player.temp=0;End;done.player=0;split_next.player=2;player_ante.player=0;End;Return;SHUFFLE_DECK:;Call WRITE(3,"","Dealer has shuffled the deck.");Do count=1 To 52;newcount=Random(1,52,Time(S));temp= deck.newcount;deck.newcount= deck.count;deck.count=temp;End;shuffle=Random(200,300);Do count=1 To shuffle;newcount=Random(1,52,Time(S));swapcount=Random(1,52,Time(S));temp= deck.newcount;deck.newcount= deck.swapcount;deck.swapcount=temp;End;deck_position=1;Return;SETUP:;numberword.1="First";numberword.2="Second";numberword.3="Third";numberword.4="Forth";numberword.5="Fifth";numberword.6="Sixth";numberword.7="Seventh";numberword.8="Eighth";numberword.9="Nineth";numberword.10="Tenth";numberword.11="Eleventh";numberword.12="Twelve";numberword.13="Thirteenth";numberword.14="Fourteenth";numberword.15="Fifthteenth";suit.1="Hearts";suit.2="Diamonds";suit.3="Clubs";suit.4="Spades";numbers.1="Ace";numbers.2="Two";numbers.3="Three";numbers.4="Four";numbers.5="Five";numbers.6="Six";numbers.7="Seven";numbers.8="Eight";numbers.9="Nine";numbers.10="Ten";numbers.11="Jack";numbers.12="Queen";numbers.13="King";value.1=11;Do count=2 To 10;value.count=count;End;value.11=10;value.12=10;value.13=10;Do count=1 To 52;deck.count=count;End;Call SETUP_PAUSE;Return;SETUP_PLAYERS:;Call DO_PAUSE;player_name.1="Dealer";player_cash.1=0;player_ante.1=100;number_of_players=1;Do Forever;"GetLine";/* Parse Pull line.command line.prefix line.rest */;temp=Pos("!",line.prefix)-1;If temp<0 Then Iterate;nick=Left(line.prefix,temp);mess=Upper(line.rest);found=0;Do count=2 To number_of_players;If nick=player_name.count Then found=count;End;Call MASTER_COMMANDS;If nick=mynick&mess=quitmsg Then Break;If Upper(Compress(line.command))="NICK" Then;Do;If nick=mynick Then mynick= Delstr(line.dest,1,1);If found ~=0 Then player_name.found= Delstr(line.dest,1,1);End;If Upper(Compress(line.command))="JOIN"& Delstr(line.dest,1,1)=channel Then;Do;If found=0 Then;Do;Call QWRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton is being played in this channel.");Call QWRITE(1,nick,"Type !JOIN to join in the fun, or type !HELP for info.");End;Else;Do;Call QWRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton is being played in this channel.");Call QWRITE(1,nick,"Welcome back, you are still joined in the game and you have $"player_cash.found" left.");End;End;If Pos(":!HELP",mess) ~=0 Then Call HELP_MESSAGE;If Pos(":!JOIN",mess) ~=0 Then;Do;If found=0 Then;Do;number_of_players=number_of_players+1;player_name.number_of_players=nick;player_cash.number_of_players=100;player_ante.number_of_players=0;Call WRITE(1,nick,"You have joined in this game!");End;Else Call QWRITE(1,nick,"You have already joined this game!");End;If Pos(":!QUIT",mess) ~=0&found ~=0 Then;Do;If found ~=number_of_players Then;Do;Do count=found to number_of_players-1;temp=count+1;player_name.count=player_name.temp;player_cash.count=player_cash.temp;player_ante.count=player_ante.temp;End;End;number_of_players=number_of_players-1;Call QWRITE(1,nick,"You have quit "pontoon", I hope you enjoyed playing it!");End;End;If number_of_players=1 Then Call WRITE(1,"","has waited 2 minutes and nobody is playing, so "pontoon" is quiting!");Return;ANTE_PLAYERS:;players_in=0;Do while players_in=0;Call WRITE(1,"","is ready to play the next hand.");Call WRITE(1,"","Type '!ANTE X' , where X is the amount cash to bet on your next hand.");Do count=2 To number_of_players;Call QWRITE(1,player_name.count,"You have $"player_cash.count". Use !ANTE to join in the next hand.");End;Call DO_PAUSE;players_in=1;Do While players_in<number_of_players;"GetLine";/* Parse Pull line.command line.prefix line.rest */;temp=Pos("!",line.prefix)-1;If temp<0 Then Iterate;nick=Left(line.prefix,temp);mess=Upper(line.rest);found=0;Do count=2 To number_of_players;If nick=player_name.count Then found=count;End;Call MASTER_COMMANDS;If nick=mynick&mess=quitmsg Then Break;If Upper(Compress(line.command))="NICK" Then;Do;If nick=mynick Then mynick= Delstr(line.dest,1,1);If found ~=0 Then player_name.found= Delstr(line.dest,1,1);End;If Upper(Compress(line.command))="JOIN"& Delstr(line.dest,1,1)=channel Then;Do;If found=0 Then;Do;Call WRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton is being played in this channel.");Call WRITE(1,nick,"Type !JOIN to join in the fun, or type !HELP for info.");End;Else;Do;Call WRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton is being played in this channel.");Call WRITE(1,nick,"Welcome back, you are still joined in the game and you have $"player_cash.found" left.");Call WRITE(1,nick,"Type '!ANTE X' , where X is the amount of cash to bet on your next hand.");End;End;If Pos(":!HELP",mess) ~=0 Then Call HELP_MESSAGE;If Pos(":!JOIN",mess) ~=0 Then;Do;If found=0 Then;Do;number_of_players=number_of_players+1;player_name.number_of_players=nick;player_cash.number_of_players=100;player_ante.number_of_players=0;Do count=1 To 4;hand.number_of_players.count="";total.number_of_players.count=0;cards.number_of_players.count=0;aces.number_of_players.count=0;can_split.number_of_players.count=0;End;done.number_of_players=0;split_next.number_of_players=2;Call QWRITE(1,nick,"You have joined in this game!");End;Else Call QWRITE(1,nick,"You have already joined this game!");End;If Pos(":!QUIT",mess) ~=0&found ~=0 Then;Do;If player_ante.found>0 Then players_in=players_in-1;If found ~=number_of_players Then;Do;Do count=found to number_of_players-1;temp=count+1;player_name.count=player_name.temp;player_cash.count=player_cash.temp;player_ante.count=player_ante.temp;End;End;number_of_players=number_of_players-1;found=0;Call QWRITE(1,nick,"You have quit "pontoon", I hope you enjoyed playing it!");End;If Pos(":!ANTE",mess) ~=0 Then;Do;If found>1 Then;Do;temp=Substr(Compress(mess),Pos(":!ANTE",mess)+6);If temp<1|temp>player_cash.found Then Call WRITE(1,nick,"You can't stake that much, you must stake something between $1 and $"player_cash.found".");Else;Do;If player_ante.found=0 Then;Do;player_ante.found=temp;players_in=players_in+1;player_cash.found=player_cash.found-temp;Call QWRITE(1,nick,"You have staked $"player_ante.found" on the next hand, and have $"player_cash.found" left.");End;Else;Do;Call QWRITE(1,nick,"You have already staked $"player_ante.found" on the next hand!");End;End;End;Else Call QWRITE(1,nick,"You must use !JOIN, before you can play a hand of pontoon.");End;End;If number_of_players=1 Then Call WRITE(1,"","Nobody is left in the game, so "pontoon" is quiting!");If number_of_players=1 Then Break;players_in=0;Do count=2 To number_of_players;If player_ante.count>0 Then;Do;players_in=players_in+1;players_list.players_in=count;End;End;End;players_in=players_in+1;players_list.players_in=1;Return;HELP_MESSAGE:;If Pos("PLAYING",mess) ~=0 Then;Do;Call QWRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton (PLAYING HELP).");Call QWRITE(1,nick,"Pontoon (Twenty-One/Blackjack) is a card game where all the players try and beat the dealer. To beat the dealer, your cards must total more than the dealers total, but not more than 21.");Call QWRITE(1,nick,"Cards Two to Ten count 2 to 10 respectively, all court cards (Jack/Queen/King) count 10. An Ace is a special card, that counts as 11, unless you draw a new card that would make you bust (go over 21) and then counts as 1.");Call QWRITE(1,nick,"Everbody get's 2 cards to start with. In the first 2 cards, a total of 21 with a court card and an Ace is called a PONTOON. Dealers PONTOON beats all players. A players PONTOON beats the Dealer, unless the Dealer has PONTOON.");Call QWRITE(1,nick,"3 Sevens in 3 cards is called a ROYAL PONTOON, and beats anything the Dealer may have. A hand of 5 cards with a total less than 22 is called a FIVE CARD TRICK, this beats anything the Dealer has, except a FIVE CARD TRICK.");Call QWRITE(1,nick,"Then each player take a turn, and tries to get the best hand they can. You do this by getting more cards (Twist) and then finishing when your happy with the total (Stick). You can't stick on less than 16, unless you have a FIVE CARD TRICK!");End;Else;Do;If Pos("COMMANDS",mess) ~=0 Then;Do;Call QWRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton (COMMANDS HELP).");Call QWRITE(1,nick,"To join in, you must use the !JOIN command, and if you want to leave, use the !QUIT command. To play a hand of pontoon use the !ANTE XXXX command when pontoon asks you to ante.");Call QWRITE(1,nick,"All hands are played for a cash amount, you are given $100 when you join, and if you lose all your money, you will be out of the game, and have to join again!");Call QWRITE(1,nick,"When a hand is being played, you will see the dealer, telling everbody who's go it is, and if it's your go, you will get a message telling you what cards you have, and what commands you can use.");Call QWRITE(1,nick,"!TWIST will deal another card to your hand, !STICK will end your turn and move on to the next player. !DOUBLE will double your ante, and deal one more card to your hand if your total is between 9,10,11 on two cards.");Call QWRITE(1,nick,"!SPLIT will split a pair of cards (if you have two cards and two of a kind, like two kings) into two hands (you ante the same amount for the new hand).");End;Else;Do;Call QWRITE(1,nick,"AmIRC "pontoon" V1.3 By David Newton (HELP).");Call QWRITE(1,nick,"Type '!HELP PLAYING' for help on how to play pontoon, or '!HELP COMMANDS' for help on pontoon's commands.");End;End;Return;MASTER_COMMANDS:;If mess=":%HELP" Then;Do;Call MYSELF(1,"AmIRC "pontoon" V1.3 By David Newton (MASTER CONTROL HELP).");Call MYSELF(1,"These commands are for use when running the "pontoon" script.");Call MYSELF(1,"NO OUTSIDE PLAYER CAN USE THESE %% COMMANDS!");Call MYSELF(1,"You must send a message to yourself in order to use these commands.");Call MYSELF(1,"COMMANDS:");Call MYSELF(1,"%%HELP    - Your looking at it!");Call MYSELF(1,"%%QUIT %%r - Quits Pontoon, and gives the quit reason %%r.");Call MYSELF(1,"%%LIST    - Returns a list of all the current players.");Call MYSELF(1,"%%KILL %%n - Removes the player number %%n, from the game.");End;If Pos(":%QUIT",mess) ~=0 Then;Do;tmp=Substr(mess,Pos(":%QUIT",mess)+6);If tmp="" Then tmp="!";Else tmp=" because :"tmp;Call WRITE(1,"","Is Quiting"tmp);Do temp=2 To number_of_players;If player_ante.temp>0 Then player_cash.temp=player_cash.temp+player_ante.temp;Call WRITE(1,player_name.temp,"Has finished. You had $"player_cash.temp" left!");Call WRITE(1,player_name.temp,"Thanks for playing "pontoon", I hope you enjoyed it!");End;Exit;End;If mess=":%LIST" Then;Do;Call MYSELF(1,"PLAYER LIST:");Call MYSELF(1,"1 = Dealer.");Do temp=2 To number_of_players;Select;When player_ante.temp=-1 Then Call MYSELF(1,temp" = "player_name.temp" - has dropped out or been removed!");When player_ante.temp=-2 Then Call MYSELF(1,temp" = "player_name.temp" - hasn't responded in time!");When player_ante.temp=0 Then Call MYSELF(1,temp" = "player_name.temp" - hasn't ante'd up yet!");When player_ante.temp>0 Then Call MYSELF(1,temp" = "player_name.temp" - is in the current hand!");End;End;End;If Pos("%KILL",mess) ~=0 Then;Do;temp=Substr(Compress(mess),Pos(":%KILL",mess)+6);If temp>1&temp<=number_of_players Then;Do;Call WRITE(1,"",player_name.temp" has been removed from the game!");found=temp;mess=":!QUIT";nick=player_name.temp;End;Else Call MYSELF(1,"Player number "temp" can't be removed!");End;Return;MYSELF:;Parse Arg arg1,arg3;"Echo P="d2c(27)"xPontoon: "arg3;If arg1 ~=0 Then Call Delay(arg1*50);Return;WRITE:;Parse Arg arg1,arg2,arg3;If arg2 ~="" Then "Raw PRIVMSG "arg2" :"pontoon": "arg3;Else "Say /Notice "channel" "pontoon": "arg3;If arg1 ~=0 Then Call Delay(arg1*50);Return;QWRITE:;Parse Arg arg1,arg2,arg3;If arg2 ~="" Then "Raw PRIVMSG "arg2" :"pontoon": "arg3;Else "Raw NOTICE "channel" :"pontoon": "arg3;If arg1 ~=0 Then Call Delay(arg1*50);Return;DO_PAUSE:;temp=Random(1,1000,Time(S));count=Random(1,1000,Time(S));newtemp=Random(1,1000,Time(S));quitmsg=":CARRY ON PONTOON "newtemp" "temp" "count;Address Command "Run Rx T:PontoonPause.AMIRX 60 "ouradr" "mynick" "quitmsg;Return;SETUP_PAUSE:;If Open('File1','T:PontoonPause.AMIRX','W') Then;Do;Call Writeln('File1','/* PontoonPause.AMIRX Written By David Newton (c) 1996 */');Call Writeln('File1','Parse Arg seconds ouradr mynick quitmsg');Call Writeln('File1','If seconds ~= 0 Then Call Delay(seconds * 50)');Call Writeln('File1','com = "Raw NOTICE "mynick" "quitmsg');Call Writeln('File1','If quitmsg ~= "" Then Interpret "Address" ouradr "com"');Call Close('File1');End;Else;Do;"Echo P="d2c(27)"x«Pontoon» "d2c(2)"Error:"d2c(2)" Unable to write pontoon pause rexx script to T: !";Exit;End;Return